package operation.madiator.obj;

import operation.madiator.abs.Colleague;
import operation.madiator.abs.Mediator;

public class Curtain extends Colleague {
    public Curtain(Mediator mediator, String name) {
        super(mediator, name);
        mediator.register(name, this);
    }

    // 若没有影响其他的同事类
    // 则不需要提交消息到中介者
    public void upCurtain() {
        System.out.println("curtain up");
    }

    @Override
    protected void sendMessage(int stateChange) {
        this.getMediator()
                .getMessage(stateChange, this.getName());
    }
}
